package com.qfoud.edu.aunt.commons.utils;

import com.alibaba.druid.pool.DruidDataSource;
import com.qfoud.edu.dbutils.framwork.core.QueryRunner;

/**
 * @author xiaobobo
 * @title: JdbcUtils
 * @projectName cd-java-2303-project-parent
 * @description: TODO
 * @date 2023/5/11  9:13
 */
public class JdbcUtils {

    private  static  DruidDataSource dataSource=null;

    static {
        dataSource=new DruidDataSource();
        dataSource.setUsername("root");
        dataSource.setPassword("root");
        dataSource.setUrl("jdbc:mysql:///cd_2303?useUnicode=true&characterEncoding=UTF-8");
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    }


    public static QueryRunner queryRunner(){
        return new QueryRunner(dataSource);
    }

}
